package test;

import  java.util.*;
class IllegalScoreException  extends Exception{

	public IllegalScoreException(int x){
		super();
	}
}
class IllegalNameException  extends Exception{

	public IllegalNameException(){  
		super();
	}
}
class Student{
	private String name;
	private int score;

	public Student(String name, int score) {
		super();
		this.name = name;
		this.score = score;
	}

	public String getName() {
		return name;
	}
	
	public void setName(String name) throws IllegalNameException{
		
		char fir = name.charAt(0);
		if(fir>='0' && fir <='9'){
			throw new IllegalNameException();
		}
		this.name = name;
	}

	public int getScore() {
		return score;
	}
	public void setScore(int score) {
		this.score = score;
	}

	public int addScore(int score) throws IllegalScoreException{
	    int answer = -1;
	    if((score < 0) || (score > 100))
	    	 throw new IllegalScoreException(score);
	    else
	    	answer = score;
		return answer;
	}
	public String toString() {
		return "Student [name=" + name + ", score=" + score + "]";
	}
}
public class Main {

	public static void main(String[] args) throws IllegalScoreException, IllegalNameException {
		Scanner in = new Scanner(System.in);
		while(in.hasNextLine()){
			String str = in.nextLine();
			if(str.equals("new")){
				Student stu = new Student(in.next(),in.nextInt());
				try{
					stu.setName(stu.getName());
					stu.addScore(stu.getScore());
					System.out.println(stu);
				}catch(IllegalScoreException e1){
					System.out.println(e1+": score out of range, score="+stu.getScore());
				}catch( IllegalNameException e2){
					System.out.println(e2+": the first char of name must not be digit, name="+stu.getName());
				}
			}
		}
		in.close();
		System.out.println("scanner closed");
	}
}
 